<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<base href="<%=basePath%>">
		<meta charset="utf-8" />
		<title></title>
		<meta name="description" content="overview & stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link href="static/css/bootstrap.min.css" rel="stylesheet" />
		<link href="static/css/bootstrap-responsive.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="static/css/font-awesome.min.css" />
		<!-- 下拉框 -->
		<link rel="stylesheet" href="static/css/chosen.css" />
		
		<link rel="stylesheet" href="static/css/ace.min.css" />
		<link rel="stylesheet" href="static/css/ace-responsive.min.css" />
		<link rel="stylesheet" href="static/css/ace-skins.min.css" />
		
		<link rel="stylesheet" href="static/css/datepicker.css" /><!-- 日期框 -->
		<script type="text/javascript" src="static/js/jquery-1.7.2.js"></script>
		<script type="text/javascript" src="static/js/jquery.tips.js"></script>
		
<script type="text/javascript">
	
	
	//保存
	function edit(){
		if($("#main_time").val()==""){
			$("#main_time").tips({
				side:3,
	            msg:'请输入',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#main_time").focus();
			return false;
		}
		if($("#main_price").val()==""){
			$("#main_price").tips({
				side:3,
	            msg:'请输入',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#main_price").focus();
			return false;
		}
		if($("#main_principal").val()==""){
			$("#main_principal").tips({
				side:3,
	            msg:'请输入',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#main_principal").focus();
			return false;
		}
		if($("#main_gasoline_cost").val()==""){
			$("#main_gasoline_cost").tips({
				side:3,
	            msg:'请输入',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#main_gasoline_cost").focus();
			return false;
		}
		if($("#main_maintain_cost").val()==""){
			$("#main_maintain_cost").tips({
				side:3,
	            msg:'请输入',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#main_maintain_cost").focus();
			return false;
		}
		if($("#main_month").val()==""){
			$("#main_month").tips({
				side:3,
	            msg:'请输入',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#main_month").focus();
			return false;
		}
		if($("#main_maintain_time").val()==""){
			$("#main_maintain_time").tips({
				side:3,
	            msg:'请输入',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#main_maintain_time").focus();
			return false;
		}
		if($("#main_toll").val()==""){
			$("#main_toll").tips({
				side:3,
	            msg:'请输入',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#main_toll").focus();
			return false;
		}
		if($("#main_remark").val()==""){
			$("#main_remark").tips({
				side:3,
	            msg:'请输入',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#main_remark").focus();
			return false;
		}
		if($("#main_month_total").val()==""){
			$("#main_month_total").tips({
				side:3,
	            msg:'请输入',
	            bg:'#AE81FF',
	            time:2
	        });
			$("#main_month_total").focus();
			return false;
		}
		$("#Form").submit();
		$("#zhongxin").hide();
		$("#zhongxin2").show();
	}
	
</script>
	</head>
<body>
	<form action="carmaintenance/${msg }.do" name="Form" id="Form" method="post">
		<input type="hidden" name="main_id" id="main_id" value="${pd.main_id}"/>
		<div id="zhongxin">
		<table id="table_report" class="table table-striped table-bordered table-hover">
			<tr>
				<td style="width:100px;text-align: right;padding-top: 13px;">车牌号:</td>
				<td><input readonly="true" type="text" name="car_number" id="car_number" value="${pd.car_number}" maxlength="32" placeholder="这里输入" title=""/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">维护日期:</td>
				<td><input class="span10 date-picker" name="main_time" id="main_time" value="${pd.main_time}" type="text" data-date-format="yyyy-mm-dd" readonly="readonly" style="width:220px;" placeholder="维护日期"/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">维护费用:</td>
				<td><input type="text" name="main_price" id="main_price" value="${pd.main_price}" maxlength="32" placeholder="这里输入" title=""/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">负责人:</td>
				<td><input type="text" name="main_principal" id="main_principal" value="${pd.main_principal}" maxlength="32" placeholder="这里输入" title=""/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">加油费:</td>
				<td><input type="text" name="main_gasoline_cost" id="main_gasoline_cost" value="${pd.main_gasoline_cost}" maxlength="32" placeholder="这里输入" title=""/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">保养费用:</td>
				<td><input type="text" name="main_maintain_cost" id="main_maintain_cost" value="${pd.main_maintain_cost}" maxlength="32" placeholder="这里输入" title=""/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">月份:</td>
				<td>
				<select class="chzn-select" name="main_month" id="main_month" style="vertical-align:top;width: 220px;">
				<option value=""></option>
					<option value="1" <c:if test="${pd.main_month == 1}">selected="selected"</c:if>>一月</option>
					<option value="2" <c:if test="${pd.main_month == 2}">selected="selected"</c:if>>二月</option>
					<option value="3" <c:if test="${pd.main_month == 3}">selected="selected"</c:if>>三月</option>
					<option value="4" <c:if test="${pd.main_month == 4}">selected="selected"</c:if>>四月</option>
					<option value="5" <c:if test="${pd.main_month == 5}">selected="selected"</c:if>>五月</option>
					<option value="6" <c:if test="${pd.main_month == 6}">selected="selected"</c:if>>六月</option>
					<option value="7" <c:if test="${pd.main_month == 7}">selected="selected"</c:if>>七月</option>
					<option value="8" <c:if test="${pd.main_month == 8}">selected="selected"</c:if>>八月</option>
					<option value="9" <c:if test="${pd.main_month == 9}">selected="selected"</c:if>>九月</option>
					<option value="10" <c:if test="${pd.main_month == 10}">selected="selected"</c:if>>十月</option>
					<option value="11" <c:if test="${pd.main_month == 11}">selected="selected"</c:if>>十一月</option>
					<option value="12" <c:if test="${pd.main_month == 12}">selected="selected"</c:if>>十二月</option>		
				</select>
				</td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">保养时间:</td>
				<td><input class="span10 date-picker" name="main_maintain_time" id="main_maintain_time" value="${pd.main_maintain_time}" type="text" data-date-format="yyyy-mm-dd" readonly="readonly" style="width:220px;" placeholder="保养时间"/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">过路桥费:</td>
				<td><input type="text" name="main_toll" id="main_toll" value="${pd.main_toll}" maxlength="32" placeholder="这里输入" title=""/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">月度总费用:</td>
				<td><input type="text" name="main_month_total" id="main_month_total" value="${pd.main_month_total}" maxlength="32" placeholder="这里输入" title=""/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">备注:</td>
				<td><textarea name="main_remark" id="main_remark" rows="5" cols="5">${pd.main_remark}</textarea></td>
			</tr>
			<tr>
				<td style="text-align: center;" colspan="10">
					<a class="btn btn-mini btn-primary" onclick="edit();">修改</a>
					<a class="btn btn-mini btn-danger" onclick="top.Dialog.close();">取消</a>
				</td>
			</tr>
		</table>
		</div>
		
		<div id="zhongxin2" class="center" style="display:none"><br/><br/><br/><br/><br/><img src="static/images/jiazai.gif" /><br/><h4 class="lighter block green">提交中...</h4></div>
		
	</form>
	
	
		<!-- 引入 -->
		<script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
		<script src="static/js/bootstrap.min.js"></script>
		<script src="static/js/ace-elements.min.js"></script>
		<script src="static/js/ace.min.js"></script>
		<script type="text/javascript" src="static/js/chosen.jquery.min.js"></script><!-- 下拉框 -->
		<script type="text/javascript" src="static/js/bootstrap-datepicker.min.js"></script><!-- 日期框 -->
		<script type="text/javascript">
		$(top.hangge());
		$(function() {
			
			//单选框
			$(".chzn-select").chosen(); 
			$(".chzn-select-deselect").chosen({allow_single_deselect:true}); 
			
			//日期框
			$('.date-picker').datepicker();
			
		});
		
		</script>
</body>
</html>